package org.metasketch.demo.model;

import org.metasketch.model.CommonIdentified;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;

@XStreamAlias("coordination-link")
public class CoordinationLink extends CommonIdentified {

	// TODO for now use this to distinguish between causal links and conditional
	// links.
	// later we'll see if there is a need for differentiation at the class level

	@XStreamAsAttribute
	boolean conditional = false;

	@XStreamAsAttribute
	int lower = 1;
	
	@XStreamAsAttribute
	int upper = 1;

	//by id
	@XStreamAsAttribute
	@XStreamAlias("source-transaction-step")
	TransactionStep source;
	
	//by id
	@XStreamAsAttribute
	@XStreamAlias("target-transaction-step")
	TransactionStep target;


	public boolean isConditional() {
		return conditional;
	}

	public void setConditional(boolean conditional) {
		this.conditional = conditional;
		
//		CoordinationStepKind.
		
	}

	public int getLower() {
		return lower;
	}

	public void setLower(int low) {
		this.lower = low;
	}

	public int getUpper() {
		return upper;
	}

	public void setUpper(int high) {
		this.upper = high;
	}

	public TransactionStep getSource() {
		return source;
	}

	public void setSource(TransactionStep sourceTransactionStep) {
		this.source = sourceTransactionStep;
	}

	public TransactionStep getTarget() {
		return target;
	}

	public void setTarget(TransactionStep targetTransactionStep) {
		this.target = targetTransactionStep;
	}

}
